﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web;
using System.Web.UI;
using System.Text;
/// <summary>
/// Summary description for MessageDialog
/// </summary>
public class MessageDialog
{
    //Show message dialog 
	public static void MessDialog(string message, Page page)
	{
        StringBuilder sb = new StringBuilder();
        sb.Append("alert('");
        sb.Append(message.Replace("\n", "\\n").Replace("\r", "").Replace("'", "\\'"));
        sb.Append("');");
        ScriptManager.RegisterStartupScript(page.Page, page.GetType(), "showalert",sb.ToString(), true);

	}
}